document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
	// when all is done, execute bootstrap angular application
	angular.bootstrap(document, ['myApp']);
}

document.addEventListener('appready', function () {
	/**
	 * turn off splashscreen
	 */
	setTimeout(function () {
		if (typeof navigator.splashscreen !== 'undefined') {
			navigator.splashscreen.hide();
		}
	}, 1000);

}, false);


/**
 * windows phone fixes
 */
if (typeof window.console === "undefined")
{
	window.console = {
		log: function (str) {
			window.external.Notify(str);
		}
	};
}
window.onerror = function (e, url, lineNumber)
{
	console.log("ERROR! : " + url + "(" + lineNumber + ") : " + JSON.stringify(e));
};
console.log("Installed console ! ");